perm filename DVITY.DIF[WEB,ALS] blob sn#772016 filedate 1984-10-15 generic text, type T, neo UTF8
  1) DVITYP.WEB[TEX,SYS] and 2) DV.WEB[WEB,ALS]	10-15-84 10:34	pages 1,1

**** File 1) DVITYP.WEB[TEX,SYS]/1P/4L
1)	C00003 00002	% This program by D. E. Knuth is not copyrighted and can be used freely.
1)	C00006 00003	@* Introduction.
1)	C00016 00004	@* The character set.
1)	C00024 00005	@* Device-independent file format.
1)	C00062 00006	@* Input from binary files.
1)	C00074 00007	@* Reading the font information.
1)	C00093 00008	@* Optional modes of output.
1)	C00109 00009	@* Defining fonts.
1)	C00119 00010	@* Low level output routines.
1)	C00121 00011	@* Translation to symbolic form.
1)	C00148 00012	@* Skipping pages.
1)	C00152 00013	@* Using the backpointers.
1)	C00157 00014	@* Reading the postamble.
1)	C00163 00015	@* The main program.
1)	C00169 00016	@* System-dependent changes.
1)	C00170 00017	@* Index.
1)	C00171 ENDMK
1)	C⊗;
1)	% This program by D. E. Knuth is not copyrighted and can be used freely.
1)	% Version 1 was completed in September, 1982.
1)	% Slight changes were made in October, 1982, for version 0.7 of TeX.
1)	% Version 1.1 corrected minor bugs (May, 1983).
1)	% Version 2 was released with version 0.999 of TeX (July, 1983).
1)	% Version 2.1 corrected a bug when no fonts are present (September, 1983).
1)	% Version 2.2 corrected bugs in max_*_so_far and put1 (October, 1983).
1)	% Version 2.3 corrected spacing of accents (March, 1984).
1)	% Version 2.4 fixed rounding, changed oriental font conventions (April, 1984).
1)	% Version 2.5 improved the case of zero pages (May, 1984).
1)	% Version 2.6 introduced max_drift (June, 1984).
1)	% Version 2.7 had minor editorial changes (August, 1984).
1)	% Here is TeX material that gets inserted after \input webmac
**** File 2) DV.WEB[WEB,ALS]/1P/4L
2)	C00003 00002	% This program by A. L. Samuel is not copyrighted and can be used freely.
2)	C00007 00003	@* Introduction.
2)	C00017 00004	@* The character set.
2)	C00025 00005	@* Device-independent file format.
2)	C00063 00006	@* Input from binary files.
2)	C00075 00007	@* Reading the font information.
2)	C00094 00008	@* Optional modes of output.
2)	C00110 00009	@* Defining fonts.
2)	C00120 00010	@* Low level output routines.
2)	C00122 00011	@* Translation to symbolic form.
2)	C00149 00012	@* Skipping pages.
2)	C00153 00013	@* Using the backpointers.
2)	C00158 00014	@* Reading the postamble.
2)	C00164 00015	@* The main program.
2)	C00170 00016	@* System-dependent changes.
  1) DVITYP.WEB[TEX,SYS] and 2) DV.WEB[WEB,ALS]	10-15-84 10:34	pages 1,1

2)	C00171 00017	@* Index.
2)	C00172 ENDMK
2)	C⊗;
2)	% This program by A. L. Samuel is not copyrighted and can be used freely.
2)	% It is based on Version 2.7 of the program DVITYP.WEB by D. E. Knuth which
2)	%    was specifically designed to serve as a model for programs such as this.
2)	% Large portions of DVITYP.WEB have been copied, essentially verbatum, to form
2)	%    the DVI file handling portions of the present program.
2)	% Here is TeX material that gets inserted after \input webmac
***************


**** File 1) DVITYP.WEB[TEX,SYS]/2P/23L
1)	\def\title{DVI$\,$\lowercase{type}}
1)	\def\contentspagenumber{401}
**** File 2) DV.WEB[WEB,ALS]/2P/16L
2)	\def\title{DVIIMAGEN}
2)	\def\contentspagenumber{401}
***************


**** File 1) DVITYP.WEB[TEX,SYS]/2P/29L
1)		\centerline{\titlefont The {\ttitlefont DVItype} processor}
1)		\vskip 15pt
1)		\centerline{(Version 2.7, August 1984)}
1)		\vfill}
**** File 2) DV.WEB[WEB,ALS]/2P/22L
2)		\centerline{\titlefont The {\ttitlefont DVIIMAGEN processor}
2)		\vskip 15pt
2)		\centerline{(Version 0.1, October 1984)}
2)		\vfill}
***************


**** File 1) DVITYP.WEB[TEX,SYS]/3P/2L
1)	The \.{DVItype} utility program reads binary device-independent (``\.{DVI}'')
1)	files that are produced by document compilers such as \TeX, and converts them
1)	into symbolic form. This program has two chief purposes: (1)~It can be used to
1)	determine whether a \.{DVI} file is valid or invalid, when diagnosing
1)	compiler errors; and (2)~it serves as an example of a program that reads
1)	\.{DVI} files correctly, for system programmers who are developing
1)	\.{DVI}-related software.
1)	Goal number (2) needs perhaps a bit more explanation. Programs for
1)	typesetting need to be especially careful about how they do arithmetic; if
**** File 2) DV.WEB[WEB,ALS]/3P/2L
2)	The \.{DVIIMAGEN} utility program reads binary device-independent (``\.{DVI}'')
2)	files that are produced by document compilers such as \TeX, and converts them
2)	into the device-specific form as required by the IMAGEN printer. It has been
  1) DVITYP.WEB[TEX,SYS] and 2) DV.WEB[WEB,ALS]	10-15-84 10:34	pages 3,3

2)	written in the \.{WEB] language to conform with the general practice for other
2)	programs of this general type and to simplify the task of adapting
2)	it for use on a variety of different computers and different operating systems.
2)	As explained in \.{DVItype}, ``programs for
2)	typesetting need to be especially careful about how they do arithmetic; if
***************


**** File 1) DVITYP.WEB[TEX,SYS]/3P/25L
1)	assumptions are violated the results will be of inferior quality.
1)	Therefore the present program is intended as a guide to proper procedure
1)	in the critical places where a bit of subtlety is involved.
1)	The first \.{DVItype} program was designed by David Fuchs in 1979, and it
**** File 2) DV.WEB[WEB,ALS]/3P/24L
2)	assumptions are violated the results will be of inferior quality.''
2)	The first \.{DVItype} program was designed by David Fuchs in 1979, and it
***************


**** File 1) DVITYP.WEB[TEX,SYS]/3P/34L
1)	The |banner| string defined here should be changed whenever \.{DVItype}
1)	gets modified.
1)	@d banner=='This is DVItype, Version 2.7' {printed when the program starts}
1)	@ This program is written in standard \PASCAL, except where it is necessary
1)	to use extensions; for example, \.{DVItype} must read files whose names
1)	are dynamically specified, and that would be impossible in pure \PASCAL.
**** File 2) DV.WEB[WEB,ALS]/3P/31L
2)	The |banner| string defined here should be changed whenever \.{DVIIMAGEN}
2)	gets modified.
2)	@d banner=='This is DVIIMAGEN, Version 0.1' {printed when the program starts}
2)	@ This program is written in standard \PASCAL, except where it is necessary
2)	to use extensions; for example, \.{DVIIMAGEN} must read files whose names
2)	are dynamically specified, and that would be impossible in pure \PASCAL.
***************


**** File 1) DVITYP.WEB[TEX,SYS]/3P/48L
1)	determine the length of a binary file. Such extensions are not necessary
1)	for reading \.{DVI} files, and they are not important for efficiency
1)	reasons either---an infrequently used program like \.{DVItype} does not
1)	have to be efficient. But they are included there because of \.{DVItype}'s
1)	r\↑↑Dole as a model of a \.{DVI} reading routine, since other \.{DVI}
1)	processors ought to be highly efficient. If \.{DVItype} is being used with
1)	\PASCAL s for which random file positioning is not efficiently available,
1)	the following definition should be changed from |true| to |false|; in such
1)	cases, \.{DVItype} will not include the optional feature that reads the
1)	postamble first.
**** File 2) DV.WEB[WEB,ALS]/3P/45L
  1) DVITYP.WEB[TEX,SYS] and 2) DV.WEB[WEB,ALS]	10-15-84 10:34	pages 3,3

2)	determine the length of a binary file. Such extensions were not necessary
2)	for reading \.{DVI} files, and they were not important for efficiency
2)	reasons either for the \.{DVItype} program but they are of signifixcant importance
2)	in a device driver that 
2)	ought to be highly efficient. If \.{DVIIMAGEN} is being used with
2)	\PASCAL s for which random file positioning is not efficiently available,
2)	the following definition should be changed from |true| to |false|; in such
2)	cases, \.{DVIIMAGEN} will not include the optional feature that reads the
2)	postamble first.
***************


**** File 1) DVITYP.WEB[TEX,SYS]/3P/76L
1)	@p program DVI_type(@!dvi_file,@!output);
1)	label @<Labels in the outer block@>@/
**** File 2) DV.WEB[WEB,ALS]/3P/72L
2)	@p program DVI_IMAGEN(@!dvi_file,@!output);
2)	label @<Labels in the outer block@>@/
***************


**** File 1) DVITYP.WEB[TEX,SYS]/3P/96L
1)	reduce \.{DVItype}'s capacity.
1)	@<Constants...@>=
**** File 2) DV.WEB[WEB,ALS]/3P/92L
2)	reduce \.{DVIIMAGEN}'s capacity.
2)	@<Constants...@>=
***************


**** File 1) DVITYP.WEB[TEX,SYS]/3P/115L
1)	\.{DVItype} will give up, after issuing an error message about the symptoms
1)	that were noticed.
**** File 2) DV.WEB[WEB,ALS]/3P/111L
2)	\.{DVIIMAGEN} will give up, after issuing an error message about the symptoms
2)	that were noticed.
***************


**** File 1) DVITYP.WEB[TEX,SYS]/3P/121L
1)	contains the only non-local |goto| statement in \.{DVItype}.
1)	@↑system dependencies@>
**** File 2) DV.WEB[WEB,ALS]/3P/117L
2)	contains the only non-local |goto| statement in \.{DVIIMAGEN}.
2)	@↑system dependencies@>
***************


  1) DVITYP.WEB[TEX,SYS] and 2) DV.WEB[WEB,ALS]	10-15-84 10:34	pages 4,4

**** File 1) DVITYP.WEB[TEX,SYS]/4P/2L
1)	Like all programs written with the  \.{WEB} system, \.{DVItype} can be
1)	used with any character set. But it uses ASCII code internally, because
**** File 2) DV.WEB[WEB,ALS]/4P/2L
2)	Like all programs written with the  \.{WEB} system, \.{DVIIMAGEN} can be
2)	used with any character set. But it uses ASCII code internally, because
***************


**** File 1) DVITYP.WEB[TEX,SYS]/4P/8L
1)	The next few sections of \.{DVItype} have therefore been copied from the
1)	analogous ones in the \.{WEB} system routines. They have been considerably
1)	simplified, since \.{DVItype} need not deal with the controversial
1)	ASCII codes less than @'40. If such codes appear in the \.{DVI} file,
**** File 2) DV.WEB[WEB,ALS]/4P/8L
2)	The next few sections of \.{DVIIMAGEN} have therefore been copied from the
2)	analogous ones in the \.{WEB} system routines. They have been considerably
2)	simplified, since \.{DVIIMAGEN} need not deal with the controversial
2)	ASCII codes less than @'40. If such codes appear in the \.{DVI} file,
***************


**** File 1) DVITYP.WEB[TEX,SYS]/4P/20L
1)	alphabets in a convenient way, especially in a program like \.{DVItype}.
1)	So we shall assume that the \PASCAL\ system being used for \.{DVItype}
1)	has a character set containing at least the standard visible characters
**** File 2) DV.WEB[WEB,ALS]/4P/20L
2)	alphabets in a convenient way, especially in a program like \.{DVIIMAGEN}.
2)	So we shall assume that the \PASCAL\ system being used for \.{DVIIMAGEN}
2)	has a character set containing at least the standard visible characters
***************


**** File 1) DVITYP.WEB[TEX,SYS]/4P/42L
1)	@ The \.{DVItype} processor converts between ASCII code and
1)	the user's external character set by means of arrays |xord| and |xchr|
**** File 2) DV.WEB[WEB,ALS]/4P/42L
2)	@ The \.{DVIIMAGEN} processor converts between ASCII code and
2)	the user's external character set by means of arrays |xord| and |xchr|
***************


**** File 1) DVITYP.WEB[TEX,SYS]/5P/2L
1)	Before we get into the details of \.{DVItype}, we need to know exactly
1)	what \.{DVI} files are. The form of such files was designed by David R.
**** File 2) DV.WEB[WEB,ALS]/5P/2L
2)	Before we get into the details of \.{DVIIMAGEN}, we need to know exactly
2)	what \.{DVI} files are. The form of such files was designed by David R.
  1) DVITYP.WEB[TEX,SYS] and 2) DV.WEB[WEB,ALS]	10-15-84 10:34	pages 5,5

***************


**** File 1) DVITYP.WEB[TEX,SYS]/5P/99L
1)	but \.{DVItype} will allow character codes greater than 255, assuming that
1)	they all have the same width as the character whose code is $c \bmod 256$.
**** File 2) DV.WEB[WEB,ALS]/5P/99L
2)	but \.{DVIIMAGEN} will allow character codes greater than 255, assuming that
2)	they all have the same width as the character whose code is $c \bmod 256$.
***************